package com.bai.ad.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * ClassName TestController
 *
 * @author Bai
 * @version 1.0
 * @date 2019/2/24 0024 下午 14:56
 **/
@Slf4j
@RestController
public class TestController {

    private final Environment environment;

    @Autowired
    public TestController(Environment environment) {
        this.environment = environment;
    }

    @GetMapping(value = "/info")
    public String getInfo(){
        return environment.getProperty("server.port");
    }
}
